

<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";


var CALLBACK = (res) => {
  // ...这里写你的业务逻辑
}

onLaunch(() => {
  console.log("App Launch");

  // 监听网络变化
  uni.onNetworkStatusChange(CALLBACK);



});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
  uni.offNetworkStatusChange(CALLBACK)
});
</script>
<style>
view {
  box-sizing: border-box;
}
</style>
